﻿<%@ Page Title="" Language="C#"  AutoEventWireup="true" CodeFile="ShoppingCart.aspx.cs" Inherits="ShoppingCart" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <style type="text/css">
        .btno
        {
            float: right;
        }
    </style>
</head>
<body>
    <form ID="f1" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top" runat="server">
    <p>
    <asp:Label ID="titleLabel" runat="server" Text="Your Shopping Cart" CssClass="CatalogTitle" />
  </p>
  <p>
    <asp:Label ID="statusLabel" runat="server" />
      <asp:GridView ID="grid" runat="server" AutoGenerateColumns="False" 
          DataKeyNames="ProductID" Width="100%" onrowdeleting="grid_RowDeleting">
          <Columns>
              <asp:BoundField DataField="Name" HeaderText="Product Name" ReadOnly="True" 
                  SortExpression="Name" />
              <asp:BoundField DataField="Price" HeaderText="Price" ReadOnly="True" 
                  SortExpression="Price" />
                   <asp:BoundField DataField="Attributes" HeaderText="Options" ReadOnly="True" />
              <asp:TemplateField HeaderText="Quantity">
                  <ItemTemplate>
                      <asp:TextBox ID="editQuantity" runat="server" CssClass="GridEditingRow" Width="24px"
            MaxLength="2" Text='<%#Eval("Quantity")%>' />
                  </ItemTemplate>
              </asp:TemplateField>
              <asp:BoundField DataField="Subtotal" DataFormatString="{0:c}" HeaderText="Subtotal"
        ReadOnly="True" SortExpression="Subtotal" />
      <asp:ButtonField ButtonType="Button" CommandName="Delete" Text="Delete"></asp:ButtonField>
          </Columns>
      </asp:GridView>
  </p>
   <p align="right">
    <span>Total amount: </span>
    <asp:Label ID="totalAmountLabel" runat="server" Text="Label" />
  </p>
  
  
   <div align="right" style="height: 47px">
  
   <input type="hidden" name="business" value="cbwang505@hotmail.com">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="your order">
<input type="hidden" name="amount" value="<%= GetFunctionStr()  %>"/>
<input type="hidden" name="currency_code" value="USD">
<input type="image" 
       src="https://www.paypalobjects.com/zh_XC/C2/i/btn/btn_buynowCC_LG.gif" 
       border="0" name="submit" alt="PayPal——最安全便捷的在线支付方式！" style="float: right">
<img alt="" border="0" src="https://www.paypalobjects.com/zh_XC/i/scr/pixel.gif" width="1" height="1">

    <asp:Button ID="updateButton" runat="server" Text="Update Quantities" 
          onclientclick="CheckDelete()" UseSubmitBehavior="False"    />     
  </div>
   </form>
  </body>
</html>
<script type="text/javascript" >
    function CheckDelete() {
        if (confirm('你确定要删除XX吗？')) {
        __doPostBack(&amp;#39;updateButton&amp;#39;,&amp;#39;&amp;#39;);
            return false;
        }
        else {
            return false;
        }
    }
    </script>
